﻿using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Input;

namespace ProjectEuler.Data
{
    internal sealed class IsBusyToCursorConverter : IValueConverter
    {
        public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
        {
            if (value is Boolean)
            {
                return ((Boolean)(value)) ? Cursors.Wait : Cursors.Arrow;
            }

            return false;
        }

        public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture)
        {
            return (value == Cursors.Wait);
        }
    }
}
